package tr.edu.metu.is550.isell.domain;

public enum PropertyType {
    HOUSE(0),
    FLAT(1);

    private final Integer value;

    private PropertyType(Integer value) {
        this.value = value;
    }

    public Integer getValue() {
        return value;
    }

    public static PropertyType getByValue(Integer value) {
        if (value.equals(PropertyType.HOUSE.getValue()))
            return PropertyType.HOUSE;
        if (value.equals(PropertyType.FLAT.getValue()))
            return PropertyType.FLAT;
        throw new NotFoundException("PropertyType", value.toString());

    }
}
